home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / bin / select_mountoptions < prev    next >
Text File  |  2009-01-11  |  966b  |  45 lines

  1. #!/bin/sh
  2.  
  3. . /usr/share/debconf/confmodule
  4.  
  5. dev=$1
  6. id=$2
  7. part=$dev/$id
  8. filesystem=$(cat $part/acting_filesystem)
  9. tpl=partman-basicfilesystems/mountoptions
  10.  
  11. cd $dev
  12.  
  13. full_options=''
  14. all_options=''
  15. descriptions=''
  16. for op in $(cat /lib/partman/mountoptions/$filesystem); do
  17.     if db_metaget partman-basicfilesystems/text/$op description && \
  18.        [ "$RET" ]; then
  19.         all_options="${all_options:+$all_options, }$op"
  20.         descriptions="${descriptions:+$descriptions, }$RET"
  21.     else
  22.         logger -t partman "Error: no description for mount option $op found; skipping"
  23.         break
  24.     fi
  25.  
  26.     if [ -f $part/options/$op ]; then
  27.         full_options="${full_options:+$full_options,}$(cat $part/options/$op)"
  28.     fi
  29. done
  30.  
  31. db_subst $tpl options "$all_options"
  32. db_subst $tpl descriptions "$descriptions"
  33. db_set $tpl "$full_options"
  34. db_input critical $tpl || true
  35. db_go || exit
  36.  
  37. db_get $tpl
  38. rm -rf $part/options
  39. mkdir $part/options
  40. IFS=,
  41. for op in $RET; do
  42.     op=${op# }
  43.     echo "$op" >$part/options/${op%% *}
  44. done
  45.